﻿global using Microsoft.AspNetCore.Mvc;

global using System.Web;
using System.Text;

namespace WXWorkSvc.Controllers;

[Route("[controller]")]
[ApiController]
public class CBController : ControllerBase
{
    /// <summary>
    /// 
    /// </summary>
    /// <param name="returnUrl"></param>
    /// <param name="code"></param>
    /// <param name="state"></param>
    /// <returns></returns>
    [HttpGet("{host}")]
    public IActionResult Get(string host, string code, string state)
    {

        return Redirect($"https://{Encoding.UTF8.GetString(Convert.FromBase64String(host))}/account/cb?state={state}&code={code}");
    }
}
